#include <iostream>
#include <cstring>
using namespace std;

class Point
{
public:
    int x;
    int y{1};
    Point(int x, int y) : x{x}, y{y} {}
    Point(int x) : x{x} {}
    bool operator==(const Point &q);
};
bool Point::operator==(const Point &q)
{
    if (q.x == x && q.y == y)
    {
        return true;
    }
    else
    {
        return false;
    }
}
int main()
{
    Point p1{1, 1};
    // 1、这个p1 == 1会调用隐式类型转换变为 p1 == pN
    // 2、调用==重载操作符
    if (p1 == 1)
    {
        cout << "p1 is equel p2" << endl;
    }
    else
    {
        cout << "p1 is not equel p2" << endl;
    }
}
